{literal}
<style>
#ulMenu{list-style:none;width:470px;}
#ulMenu li{float:left;width:115px;border-left:1px #bfbfbf solid; text-align:center;height:60px; line-height:50px;font-size:14px;color:#888888; cursor:pointer;}
#menu2_top{width:115px;height:12px;position:absolute;z-index:200;left:346px;top:83px;background-color:#ffffff;border-left:1px #b4b3b0 solid;border-right:1px #b4b3b0 solid; display:none;}
#menu2{display:none;width:170px;height:auto;background-color:#ffffff; position:absolute;z-index:100;left:346px;top:94px;border:1px #b4b3b0 solid;}
#menu2 ul{list-style:none;width:150px; padding:0; margin:auto;}
#menu2 ul li{height:40px; text-align:left; line-height:40px;border-bottom:1px dashed #aaaaaa; padding-left:8px; font-size:12px; cursor:pointer;}
#mnuRef{ position:absolute;z-index:100; left:45px; background-color:#ffffff; border:1px solid #BFBFBF;width:155px; display:none;}
#mnuRef ul{list-style:none; padding:0; margin:0; overflow:hidden;text-overflow:ellipsis; white-space:nowrap;}
#mnuRef ul li{cursor:pointer;width:100%; height:30px; line-height:30px; text-align:left; padding-left:2px;}
#mnuRef ul li:hover{ background-color:#EEE} 
</style>
<script language=JavaScript>
var headerMenuShow = false;
function showMenu(t,obj)
{
	 $("#ulMenu").find("li").each(function(){
		 $(this).css("color","#888");
		 });
	 $(obj).css("color","#FFC019");
	 if(t==1)
	 {
		 if(headerMenuShow)
		 {
			 hideMenu1()
		 }
		 else
		 {
		 	var jq = $($("#ulMenu").find("li")[1]);
		 	jq.css("font-weight","bold");
		 	jq.css("background-color","#ffffff");
		 	jq.css("border-top","1px #bfbfbf solid");
		 	$("#menu2_top").show();
		 	headerMenuShow = true;
			$("#menu2").slideToggle(500);
		 }
		 
	 }
	 else if(t==0)
	 {
		 setHeaderPos("");
		 hideMenu1();
		 //window.location.href="?act=main";
		 var l = window.location.href;
		 if(l.indexOf("op=detail")!=-1)
		 {
			 window.location.href="?act=main";
		 }
		 else
		 {
			 clearQueryParam();query();
		 }
	 }
	 else if(t==2)
	 {
		  hideMenu1();
		  setHeaderPos(obj.innerHTML);
		  headerOpenPage("?act=ajax&op=getLstFileFront&k=newPic");
	 }
	 else if(t==3)
	 {
		  hideMenu1();
		  setHeaderPos(obj.innerHTML);
		  headerOpenPage("?act=ajax&op=getLstFileFront&k=newVideo");
	 }
}
function headerOpenPage(url)
{
    var curUrl = window.location.href;
 
    if(curUrl.indexOf("op=detail")==-1)
    {
    	getPage(url);
    }
    else
    {
        window.location.href="?act=main"+url.replace("?act=ajax&op=getLstFile","");
    }
}
function hideMenu1()
{
			if(headerMenuShow)
			{
			 var jq = $($("#ulMenu").find("li")[1]);
			 headerMenuShow = false;
			 $("#menu2").slideUp(500,function(){
			 $("#menu2_top").hide();
		 	 jq.css("background-color","#f7f7f7");
		 	 jq.css("border-top","none");
			 jq.css("font-weight","normal");
				 });
			}
}
function showMyFav()
{
    setHeaderPos("我的收藏夹");
	headerOpenPage("?act=ajax&op=getLstFileFront&k=myFav");
}
function setHeaderPos(txt)
{
	if(txt=="")
	{
		$("#headerPos").html("");
	}
	else
	{
		$("#headerPos").html("<a href='?act=main'>首页</a>&nbsp;&nbsp;&nbsp;&nbsp;>&nbsp;&nbsp;&nbsp;&nbsp;"+txt);
	}
}
$(function(){
	$.get("?act=ajax&op=getNavData&id=14",function(d){
		var j = eval("("+d+")");
		$("#myName").html(j.name);
		for(i=0;i<j.menu.length;i++)
		{
			$("#menu2ul").append('<li data="'+j.menu[i].id+'">'+j.menu[i].name+'</li>');
		}
		$("#menu2 li:last").css("border","none");
		$("#menu2ul").find("li").each(function(){
				var jo = $(this);
				var id = jo.attr("data");	
			    jo.click(function(){
				  hideMenu1();
				  setHeaderPos(jo.html());
				  $("#tblsel_tdType").find("a").each(function(){
					  if($(this).html()==jo.html())
					  {
						  $(this).css("color","#FFC019");
					  }
					  else
					  {
						   $(this).css("color","#000000");
					  }
					  });
				  tdType = id;
				  headerOpenPage("?act=ajax&op=getLstFileFront&t="+jo.attr("data")+"&tag="+encodeURIComponent(jo.html()));
				  });
				 //jo.mouseover(function(){$(this).css("background-color","#EEE");})
				 //jo.mouseleave(function(){$(this).css("background-color","#FFFFFF");})
			});
		});
		$("#menu2").mouseleave(function(e) {
                hideMenu1();
            });

	});
function fav(id)
{
	$.get("?act=ajax&op=addFav&id="+id,function(data){
	    if(data.indexOf("ok")!=-1)
		{
			alert("收藏成功");
		}
	});
}
 
function down(id)
{
	//window.location.href="?act=down&id="+id;
	$.get("?act=down&op=st&id="+id,function(d){});
	window.open("?act=down&id="+id);
}
function doSearch()
{
	var key = $("#txtQuery").val();
	if(key!="")
	{
		headerOpenPage("?act=ajax&op=getLstFileFront&k="+encodeURIComponent(key));
	}
}
function keywordsPress(obj)
{
	$.get("?act=ajax&op=queryKey&k="+obj.value,function(d){
	    var j = eval("("+d+")");
		//alert(j.length);
		if(j.length>0)
		{
			var li = "";
			for(i=0;i<j.length;i++)
			{
				 li = li+"<li title='"+j[i]+"'>"+j[i]+"</li>";
			}
			$("#ulMnuRef").html(li);
			$("#mnuRef").show();
			$("#ulMnuRef").find("li").each(function(){
				var jq = $(this);
				jq.click(function(){
					obj.value=jq.html();
					$("#mnuRef").hide();
					doSearch();
					});
				});
		}
		else
		{
			$("#mnuRef").hide();
		}
	});
	
}
</script>
{/literal}
<table width="100%" height="126" cellpadding="0" cellspacing="0" style="margin:auto;">
<tr><td align="center" style="border-bottom:1px #aaaaaa dotted;background-color:#f7f7f7">
 <table width="1000" height="126" border="0" cellpadding="0" cellspacing="0" >
  <tr>
    <td width="300px" align="center" valign="middle"><img src="images/toplogo.png" width="150"></td>
    <td valign="top">
    <table width="100%" border="0" height="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td width="100%" align="right" valign="middle"><a href="help.html" target="_blank"><img src="images/help.jpg" style="vertical-align:middle;" /></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onclick="showMyFav();"><img src="images/fav1.jpg" style="vertical-align:middle;" /></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b style="color:#597ddb;" id="myName"></b>&nbsp;&nbsp;<a href="#" target="_self" onClick="logout();" style="color:#888888;">[退出]</a></td>
      </tr>
      <tr><td width="250" align="right" style="position:relative;">
      
      <ul id="ulMenu">
      <li onclick="showMenu(0,this);">首页</li>
      <li onclick="showMenu(1,this);">全部素材分类</li>
      <li onclick="showMenu(2,this);">最新图片</li>
      <li onclick="showMenu(3,this);">最新视频</li>
      </ul>
      <div id="menu2_top"></div>
      <div id="menu2">
      <ul id="menu2ul">
      </ul>
      </div>
      
      </td>
        </tr>
    </table></td>
  </tr>

</table>

</td></tr>
<tr>
  <td width="10%" height="53" valign="middle" align="center" >
  	<table cellpadding="0" cellspacing="0" width="1000"><tr><td height="50" style="padding-left: 30px;"><span id="headerPos"></span></td>
    <td align="right" width="200" valign="middle" style="position:relative;"><input type="text" onKeyUp="keywordsPress(this);" id="txtQuery"  style="vertical-align:middle;height:21px;"/>
    <div id="mnuRef">
    <ul id="ulMnuRef">
    </ul>
    
    </div>
    </td>
    <td align="right" width="90" ><img src="images/btnSearch.png" onClick="doSearch();"  style="vertical-align:middle; cursor:pointer;"/>
    </td></tr></table>
  </td>
</tr>
<tr><td style="border-top:1px #aaaaaa dotted;border-bottom:1px #aaaaaa dotted;" height="2"></td></tr>
</table>
